<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>我的订单(待收货)</title>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />
<meta name="format-detection" content="telephone=no, email=no" />
<link rel="stylesheet" href="{{ url('/common/mobile-common/common.css') }}">		
<link rel="stylesheet" href="{{ url('/mobile/css/order/common.css') }}">		
<link rel="stylesheet" href="{{ url('/mobile/css/order/order-unreceipt.css') }}">	
<script src="{{ url('mobile/js/jquery-1.8.3.min.js') }}"></script>
<script src="{{ url('/common/mobile-common/hmt.js') }}"></script>
</head>
<body>
	<div class="abouts">
		<div class="wrap-cont clearfix">
				<!--待收货和订单详情的配送方式、物流信息-->
				<div class="delivery-wl">
						<p>
							<span>配送方式: {{$res->gname}}</span>
							<span>货运单号: {{$res->waybill}}</span>
						</p>						
						<div class="wliu">
							<p>物流信息</p>
							<p class="wl-info">
								@if(empty($flow))
									<p>已发货，未获取物流！</p>
								@else
								<a href="{{url('wap/order/orderFlow/'.$res->id)}}" target="_blank">
									<em class="iconss">
										<img src="{{ url('mobile/images/ql-icon.png')}}">										
									</em>
										<span class="wl-zt">{{$flow[0]['context']}}</span>
										<span>时间:{{$flow[0]['time']}}</span>
									<i><img src="{{ url('mobile/images/more-icon.png')}}"></i>
								</a>
								@endif
							</p>
						</div>
					</div>
					<!--end-->
				<!--end-->
				<!--收货地址-->
				<div class="address clearfix">
					<img src="{{ url('mobile/images/addreee.png') }}" class="dw-icon">
					<p>
						<span>{{$res->receiver}}</span>
						<span>{{$res->phone}}</span>
						<em>{{$res->province}}&nbsp{{$res->city}}&nbsp{{$res->address}}</em>
					</p>
				</div>
				<!--end-->
				
				
				<!--待收货-->
				<div class="wap-cont unReceipt">					
					<div class="orders">
						<p class="order-num">
							<span class="logg"><img src="{{ url('mobile/images/logo2.png') }}"></span>
							<em>{{App\Http\Util\OrderStatus::getLabel($res->status)}}</em>
						</p>
						@foreach($detail as $v)
						<div class="orer-info clearfix">
							<img src="{{ config('config.picHostPrefix').$v->img }}">
							<p class="card-style">
								<span>{{$v->good_name}}</span>
								<em>类型:{{$v->type_name}}</em>
							</p>
							<p class="pri-num">
								<span>¥{{$v->price}}</span>
								<em>x1</em>
							</p>
						</div>
						@endforeach
						<p class="order-all order-jg">
							<span>运费<em>¥0.00</em></span>
							@if($res->promote_type==1&&$effect)
							<span>满{{$effect}}<em>-¥{{$cheap}}</em></span>
							@endif
							@if($res->promote_type==2&&$effect2)
								<span>满{{$effect2}}<em>送卡{{$num}}张</em></span>
							@endif
						</p>
						<p class="order-all-price">
							<span>实付款:</span>
							<em>¥{{$res->total_price}}</em>
						</p>
					</div>									
					<!--end-->
					<!--订单详细信息-->
					<div class="dd-information">
						<div>
							<p>订单号: {{$res->order_num}}</p>
							<p>下单时间:{{App\Http\Util\TimeHelper::formatDateTime($res->order_time)}}</p>
							<p>付款时间:{{App\Http\Util\TimeHelper::formatDateTime($res->pay_time)}}</p>
							<p>发货时间:{{App\Http\Util\TimeHelper::formatDateTime($res->delive_time)}}</p>
						</div>
					</div>
					<!--付款-->
					<div class="all-price clearfix">
						<p>
							<span>合计: <i>¥{{$res->total_price}}</i></span>
						</p>
						<div>
							<a href="{{url('wap/order/orderFlow/'.$res->id)}}" class="unopt">查看物流</a>
							<a href="javascript:void(0)" class="qrsh">确认收货</a>
						</div>
					</div>
				</div>
				<!--end-->
		</div>
	</div>
	
</body>
<script>
	$(function(){
		$(".qrsh").click(function(){
			var id = "{{$res->id}}";
			if(confirm("确认收货吗？")) {
				$.ajax({
					url: "{{ url('wap/order/confirmReceive') }}",
					type: "post",
					dataType: "json",
					data: {id: id},
					success: function (data) {
						if (data.success) {
							location.reload();
						}
						else {
							layer.alert(data.msg);
						}
					}
				})
			}
		})
	})
</script>
</html>
